package com.heima.utils.common;

import com.heima.model.wemedia.pojos.WmUser;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadlocalUtil {

    private static final ThreadLocal<WmUser> threadLocal = new ThreadLocal<>();
    public static void setUser(WmUser wmUser) {
        threadLocal.set(wmUser);
        log.info("ThreadlocalUtil setUser: {}", threadLocal);
    }
    public static WmUser getUser() {
        return threadLocal.get();
    }
    public static void remove() {
        threadLocal.remove();
    }
}
